<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_blank
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
?>
<div class="page-title">
    <h2><?php echo $this->__('My Tags') ?></h2>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<p>
    <?php echo $this->__('Tag Name: %s', $this->htmlEscape($this->getTagInfo()->getName())) ?>
    ( <a href="<?php echo $this->getTagInfo()->getEditTagUrl(); ?>"><?php echo $this->__('Edit Tag') ?></a>
    <span class="separator">|</span>
    <a href="<?php echo $this->getTagInfo()->getRemoveTagUrl(); ?>" onclick="return confirm('<?php echo $this->__('Are you sure you want to delete this tag?') ?>');"><?php echo $this->__('Delete Tag') ?></a> )
</p>
<?php echo $this->getToolbarHtml() ?>
<table class="data-table" id="my-tags-table">
<?php if( sizeof($this->getMyProducts()) > 0 ): ?>
    <col width="100" />
    <col />
    <col width="75" />
    <tbody>
    <?php $iterator = 0 ?>
    <?php foreach($this->getMyProducts() as $_product): ?>
        <tr<?php if($iterator % 2 == 0): ?> class="odd"<?php $iterator++;endif; ?>>
            <td><a class="product-image" href="<?php echo $_product->getProductUrl(); ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(100, 100); ?>" width="100" height="100" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" /></a></td>
            <td>
                <h3 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h3>
                <?php echo $this->getPriceHtml($_product) ?>
                <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                <p><?php echo $_product->getDescription() ?></p>
            </td>
            <td>
                <?php if($_product->isSaleable()): ?>
                    <button class="button" onclick="setLocation('<?php echo $this->getUrl('checkout/cart/add',array('product'=>$_product->getId())) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
                <?php endif; ?>
                <?php if ($this->helper('wishlist')->isAllow()) : ?>
                <p><a href="<?php echo $this->getUrl('wishlist/index/add',array('product'=>$_product->getId())) ?>"><?php echo $this->__('Add to Wishlist') ?></a></p>
                <?php endif; ?>
            </td>
        </tr>
    <?php endforeach; ?>
    </tbody>
<?php else: ?>
        <tr>
        <td><p><?php echo $this->__("Unable to find any products tagged with '%s' in the current store", $this->htmlEscape($this->getTagInfo()->getName()) ) ?></p></td>
        </tr>
<?php endif; ?>
</table>
<script type="text/javascript">decorateTable('my-tags-table')</script>
<?php echo $this->getToolbarHtml() ?>
<div class="buttons-set"><div class="floatbox">
    <a href="<?php echo $this->getUrl('*/*/')?>" class="back-link">&laquo;<?php echo $this->__('Back to Tags List')?></a>
</div></div>
